package com.guchenbo.example.lock;

public class LoopTask {

    public static volatile boolean stop = false;

    public void run(){
        while (!stop) {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("run");
        }
        System.out.println("stop");
    }
}
